﻿<UserControl x:Class="MyAnimelistRecommender.Controls.BusyIndicator"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             mc:Ignorable="d"
             x:Name="yay"
             d:DesignHeight="300" d:DesignWidth="300" Visibility="{Binding IsBusy, Converter={StaticResource BooleanToVisibilityConverter}, ElementName=yay}">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/PresentationFramework.Aero, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35,ProcessorArchitecture=MSIL;component/themes/aero.normalcolor.xaml" />
                <ResourceDictionary Source="/Resource/Style.xaml" />
                <ResourceDictionary Source="/Resource/Brush.xaml" />
                <ResourceDictionary Source="/Resource/Converter.xaml" />
            </ResourceDictionary.MergedDictionaries>

            <Storyboard x:Key="IsBusyBeginStoryboard" Storyboard.TargetName="rotototototot">
                <DoubleAnimation Storyboard.TargetProperty="Angle" From="90" To="450" Duration="0:0:3" RepeatBehavior="Forever" />
            </Storyboard>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" Name="YayGridRow" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="2*" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0,1">
                <GradientStop Color="#d7dadc" Offset="0" />
                <GradientStop Color="#40f5f8fa" Offset="0.25" />
                <GradientStop Color="#c7cace" Offset="1" />
            </LinearGradientBrush>
        </Grid.Background>
        <Border Name="YayGridCol" Grid.Row="1" Grid.Column="1" BorderBrush="#cccccc" BorderThickness="1" CornerRadius="3" >
            <Border.Background>
                <LinearGradientBrush EndPoint="0,1">
                    <GradientStop Color="#f7fafc" Offset="0" />
                    <GradientStop Color="#f5f8fa" Offset="0.25" />
                    <GradientStop Color="#edeff2" Offset="0.75" />
                    <GradientStop Color="#e7eaee" Offset="1" />
                </LinearGradientBrush>
            </Border.Background>
            <WrapPanel>
                <Border Grid.Column="0" MinWidth="30" MinHeight="30" Width="{Binding ActualWidth,ElementName=YayGridCol,Converter={StaticResource MultiplicationConverter}, ConverterParameter=\{0.4\}}" Height="{Binding ActualWidth,ElementName=YayGridCol,Converter={StaticResource MultiplicationConverter}, ConverterParameter=\{0.4\}}">
                    <Ellipse HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="eeeee" >
                        <Ellipse.LayoutTransform>
                            <RotateTransform Angle="90" x:Name="rotototototot" />
                        </Ellipse.LayoutTransform>
                        <Ellipse.OpacityMask>
                            <RadialGradientBrush RadiusX=".5" RadiusY=".5" Center="0.5,0.5">
                                <GradientStop Color="Transparent" Offset="0.8"/>
                                <GradientStop Color="White" Offset=".81"/>
                            </RadialGradientBrush>
                        </Ellipse.OpacityMask>
                        <Ellipse.Fill>
                            <RadialGradientBrush RadiusX="1" RadiusY="1.4" Center="0.5,1.4">
                                <GradientStop Color="White" Offset="0"/>
                                <GradientStop Color="#FFFBD678" Offset="1"/>
                            </RadialGradientBrush>
                        </Ellipse.Fill>
                    </Ellipse>
                </Border>
                <Grid Grid.Column="1" Margin="0 0 0 0">
                    <TextBlock VerticalAlignment="Center" Text="Loading . . ." />
                </Grid>
            </WrapPanel>
        </Border>
    </Grid>
</UserControl>